<template>
    <div class=''>
        <p>注册</p>
        <h2>手机验证码登录</h2>
        <input type="text" v-model="data.mobile">
        <input type="text" v-model="data.password">
        <el-button type="primary" @click="goto">登录</el-button>
    </div>
</template>

<script lang="ts" setup>
import {logins} from '../request/api'
import { ref, reactive, toRefs } from 'vue';
// import { useStore } from 'vuex';
 import { useRouter, useRoute } from 'vue-router';
// const store = useStore();
const router = useRouter();
const route = useRoute();
const data = reactive({
    mobile:'13230000059',
    password:'abc12345'    
});
const goto=()=>{
    logins(data).then((res)=>{
        console.log(res);
        localStorage.setItem('token',res.data.data.token)
        router.push('/')
    })
}
</script>

<style lang='scss'>

</style>
